
;; Restore files
restore,'./emaf_paper/bgps_emaf.sav',/ver
restore,'./emaf_paper/save_files/morph_distances.sav',/ver

galactic_params
dt = !MW.R0/1.d3 * cos(emaf.l*!dtor) / cos(emaf.b*!dtor)
tan = abs(dml[*,0]-dt) LE 0.5
print,fix(total(tan))
tin = where(tan)

myps,'./emaf_paper/plots/pchoo_sigd.eps',xsize=9

yr = [0.45,1.05]

multiplot,[2,1]

cgPlot,dml[*,1] > dml[*,2],pchoo,charsize=1.0,psym=16,symsize=0.5,xr=[0,13.5],/xst,$
       xtit='Larger d!dML!n Error Bar',ytit='P!dchoose!n',yr=yr,/yst

cgOplot,dml[tin,1] > dml[tin,2],pchoo[tin],psym=14,symsize=0.7,$
        color='Deep Pink'


bin = where(dml[*,1] > dml[*,2] GE 2.,nb)
print,nb
lim=max(pchoo[bin])
print,lim
;; vline,/h,lim,linestyle=4,color='Deep Pink',thick=4 
vline,/h,0.78,linestyle=4,color='Forest Green',thick=4

al_legend,/top,/right,['Object at d!dtan!n'],psym=14,symsize=0.7,$
          color='Deep Pink',box=0,charsize=0.8

multiplot

cgPlot,dbar[*,1],pchoo,charsize=1.0,psym=16,symsize=0.5,$
       xtit='d!dbar!n Error Bar',yr=yr,/yst

cgOplot,dbar[tin,1],pchoo[tin],psym=14,symsize=0.7,$
        color='Deep Pink'
vline,/h,0.78,linestyle=4,color='Forest Green',thick=4

al_legend,/top,/right,['Object at d!dtan!n'],psym=14,symsize=0.7,$
          color='Deep Pink',box=0,charsize=0.8

myps,/done,/mp

END
